import { useState } from "react";
import axios from "axios";
import "./App.css";

function App() {
  const [count, setCount] = useState(0);

  function clickHandler(e: any) {
    axios
      .post("http://localhost:3001/data", {
        name: "daxia",
      })
      .then((data) => {
        console.log(data);
      })
      .catch((error) => {
        console.log("error: ", error);
      });
  }
  return (
    <div className="App">
      <input type="button" value="点我" onClick={clickHandler}></input>
      <div>ddd</div>
    </div>
  );
}

export default App;
